home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / fastmap.zip / FASTMAP.H < prev    next >
C/C++ Source or Header  |  1992-07-16  |  5KB  |  147 lines

  1. /* FASTMAP.H */
  2. /* Copyright (C) David Curtis 1992 */
  3.  
  4. #ifndef FASTMAP_H
  5. #define FASTMAP_H
  6.  
  7. #ifdef __ZTC__
  8. #define __ZORTECH__ 1
  9. #endif
  10.  
  11. #ifndef __SUN__ 
  12. #define __SUN__ 0
  13. #endif
  14.  
  15. #ifndef __ZORTECH__ 
  16. #define __ZORTECH__ 0
  17. #endif
  18.  
  19. #ifdef __STDC__
  20. #define CAN_PROTOTYPE 1
  21. #define USE_ENUMS 1
  22. #endif
  23.  
  24. #ifndef CAN_PROTOTYPE 
  25. #define CAN_PROTOTYPE 0
  26. #endif
  27.  
  28. #ifndef USE_ENUMS
  29. #define USE_ENUMS 0
  30. #endif
  31.  
  32. #if __ZORTECH__
  33. /* I know I can do this even if not ANSI C */
  34. #undef CAN_PROTOTYPE
  35. #define CAN_PROTOTYPE 1
  36. #undef USE_ENUMS
  37. #define USE_ENUMS 1
  38. #endif
  39.  
  40. #if CAN_PROTOTYPE 
  41. #define PROTO(args) args
  42. #else
  43. #define PROTO(args) ()
  44. #endif
  45.  
  46. #include <stdio.h>
  47. /* for FILE* */
  48.  
  49. #define MAXPEDS 100
  50. #define MAXMARKERS 30
  51. #define MAXPAIRS 10
  52. #define MAXDISTS 50
  53.  
  54. #define MINFRACTION 0.01
  55.  
  56.  
  57. struct lod_rf_t {
  58. float rf,lod;
  59. };
  60.  
  61. /* pair of values for recombination fraction and lod score to be input 
  62. by user */
  63.  
  64. struct marker_t {
  65. float prob_inf;
  66. float *nonrec,*rec,position;
  67. char name[21];
  68. float fraction_used;
  69. struct lod_rf_t **lods;
  70. int *npairs;
  71. };
  72. /* probability of marker being informative at a given locus, estimated 
  73. numbers of nonrecombinant and recombinant meioses for each pedigree, 
  74. marker name, fraction of total meioses for which it is informative, 
  75. table of input pairs of values for recombination fraction and lod, and 
  76. the number of theses pairs for each pedigree */
  77.  
  78. struct info2p_t_s {
  79. float rec,nonrec,position,fraction_used,null_like;
  80. };
  81. typedef struct info2p_t_s info2p_t;
  82. /* information about meioses for which one marker only is informative, 
  83. with marker position, the fraction of the total meioses this is and the 
  84. likelihood associated with these data at a recombination fraction of 
  85. 50% (to save recalculating for each desired lod score */
  86.  
  87. struct info3p_t_s {
  88. float rrnn[4],l_position,r_position,null_like;
  89. };
  90. typedef struct info3p_t_s info3p_t;
  91. /* as above, but for meioses informative for markers on both sides of 
  92. the disease locus */
  93.  
  94. extern float reliability[MAXPEDS];
  95. extern struct marker_t disease,*marker;
  96. extern FILE *input_file,*output_file,*graph_file,*debug_file;
  97. extern int num_points,num_peds;
  98. extern float mind,maxd;
  99. extern float **tablods,*totlods;
  100. extern float fixdist[MAXDISTS];
  101. extern int nfixdist;
  102. extern float total_meioses[MAXPEDS];
  103.  
  104. extern int init_marker PROTO((struct marker_t *m,int nfams));
  105. extern float get_prob_inf PROTO((float freq[],int nall));
  106. extern float anti_kosambi PROTO((double dist));
  107. extern float estimate_total_meioses PROTO((struct marker_t marker[],int num_markers,int pednum));
  108. extern float log_bin_like PROTO((double x,double N,double a));
  109. extern void clear_2p PROTO((info2p_t *m));
  110. extern void set_null_like_2p PROTO((info2p_t *m));
  111. extern void set_null_like_3p PROTO((info3p_t *mm));
  112. extern float lod_3p PROTO((struct marker_t *d,info3p_t *mm,double rel));
  113. extern float lod_2p PROTO((struct marker_t *d,info2p_t *m,double rel));
  114. extern float inf_rf_between PROTO((info2p_t *r,info2p_t *l));
  115. extern int meioses_from_lods PROTO((int numf,int num_markers));
  116. extern void info_from_marker PROTO((info2p_t *d,struct marker_t *s,int pednum));
  117. extern void sort_two_infos PROTO((info2p_t *l,info2p_t *r,float result[9]));
  118. extern void fix_fraction_used PROTO((info2p_t *i,double tm));
  119. extern void fill_info3p PROTO((info3p_t *p,info2p_t *l,info2p_t *r,float *rrnn));
  120.  
  121. extern char *get_line PROTO((char *line,int maxlen));
  122. extern void prompt PROTO((char *s));
  123.  
  124. extern input_marker PROTO((struct marker_t *m,int num_peds));
  125. extern float get_nr_from_lods PROTO((struct marker_t *m,int ped,double rel));
  126. extern input_data PROTO((void));
  127. extern open_files PROTO((void));
  128. extern set_up_tables PROTO((int num_peds,int num_points));
  129. extern input_disease_info PROTO((struct marker_t *d));
  130. extern get_num_fams PROTO(());
  131. extern error_func PROTO((unsigned l,char *f,char *s1,char *s2));
  132. extern calculate_lods PROTO((double mind,double maxd,int num_points,struct marker_t *disease,
  133.    struct marker_t marker[],int num_markers));
  134. extern make_map PROTO((double mind,double maxd,int num_points,struct marker_t *disease,
  135.    struct marker_t marker[],int num_markers,int pednum));
  136. extern void output_tables PROTO((int num_peds,int num_points,int num_markers,
  137.        double mind,double maxd));
  138. extern float get_rf_fraction PROTO((struct lod_rf_t pairs[],int npairs,
  139.    double rel,float *ssq,double tol));
  140. extern float err_num_meioses PROTO((double N));
  141. extern float get_num_meioses PROTO((struct lod_rf_t[],int,double inf,double ratio));
  142. extern float err_rf_fraction PROTO((struct lod_rf_t[],int,double,double));
  143. extern void print_consts PROTO((void));
  144.  
  145. #endif
  146.  
  147.